<template>
  <view class="my-page">
    <MyLogin v-if="!token"></MyLogin>
    <MyUserInfo v-else></MyUserInfo>
  </view>
</template>

<script>
  import { mapState } from 'vuex'
  export default {
    data() {
      return {
        
      };
    },
    computed: {
      info() {
        return this.$store.getters.info
      },
      ...mapState('user', ['token'])
    },
    onShow() {
      uni.setTabBarBadge({
        index: 2,
        text: `${this.info}`
      })
    }
  }
</script>

<style lang="scss">
.my-page {
  height: 100vh;
  background-color: #f3f3f3;
}
</style>
